<?php
/**
 * Created by JiangJiaCai.
 * User: Administrator
 * Date: 2017/9/26 0026
 * Time: 14:19
 */

namespace App\Http\Controllers\home;


use App\Http\Controllers\BaseController;
use com_jjcbs\lib\ServiceFactory;
use ext\service\ArticleServiceImpl;
use ext\service\OrgServiceImpl;
use ext\service\ProjectServiceImpl;

/**
 * 组织架构
 * Class OrgController
 * @package App\Http\Controllers\home
 */
class OrgController extends BaseController
{
    private $orgService = null;
    private $articleService = null;

    public function __construct()
    {
        parent::__construct();
        $this->orgService = ServiceFactory::getInstance(OrgServiceImpl::class);
        $this->articleService = ServiceFactory::getInstance(ArticleServiceImpl::class);
    }


    public function index(){
        $this->model['title'] = '慈善地图';
        $this->model['cls_id'] = 0;
        $this->model['projectList'] = ServiceFactory::getInstance(ProjectServiceImpl::class)->getAllChildProjectList(29 , 3);
        $this->model['hotImg'] = $this->articleService->articleDao->getHotOneHasImg();
        $this->model['hotList'] = $this->articleService->articleDao->getHotPageList(8);
        $this->model['orgRoot'] = ServiceFactory::getInstance(OrgServiceImpl::class)->orgDao->getRoot();
        $this->model['news_list'] = $this->orgService->orgDao->getListPage(8);
        return view('maps' , $this->model);
    }
}